<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>21-Vue事件修饰符</title>

    <!--②阻止默认事件发生-->
</head>
<body>

<div id="app">

    <a href="index.html" @click.prevent="fn1()">跳转到index.html</a>

</div>

</body>
<script src="js/vue.js"></script>

<script>

    var vue = new Vue({
        el: "#app",
        data: {},
        methods: {
            fn1(){//跳转到百度
                location.href = "http://www.baidu.com"
            }
        }
    })

</script>
</html>